package com.plian.system.wrapper.hr.recruitment;

import com.plian.system.dto.hr.recruitment.PartTimeManagementDTO;
import com.plian.system.entity.hr.recruitment.PartTimeManagement;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.hr.recruitment.PartTimeManagementVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2019-12-02
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface PartTimeManagementWrapper extends BaseWrapper<PartTimeManagement, PartTimeManagementDTO, PartTimeManagementVO> {

	@Override
	@Mappings(value = {
			@Mapping(source = "createUser", target = "createUserName", qualifiedByName = USER_ID_TO_NAME),
			@Mapping(source = "approvedUser", target = "approvedUserName", qualifiedByName = USER_ID_TO_NAME),
			@Mapping(source = "companyNameId", target = "companyName", qualifiedByName = ORG_ID_TO_NAME),
//			@Mapping(source = "staffNameId", target = "staffName", qualifiedByName = STAFF_ID_TO_NAME),
			@Mapping(source = "nationId", target = "nationName", qualifiedByName = DICT_CODE_TO_NAME),
			@Mapping(source = "genderId", target = "gender", qualifiedByName = DICT_CODE_TO_NAME),
			@Mapping(source = "presentPostId", target = "presentPost")
	})
	PartTimeManagementVO entityToVO(PartTimeManagement entity);

}
